<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
  <meta charset="UTF-8"name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
  <link rel="stylesheet" href="/css/main.css" th:href="@{/css/main.css}" />
  <link rel="stylesheet" href="/css/my.css" th:href="@{/css/my.css}" />
  <link rel="stylesheet" href="/css/alert.css" th:href="@{/css/alert.css}"/>
  <title>admin page</title>
</head>
<body>
  <button id = "alertBtn">Click me</button>
  <button id = "confirm">Click me</button>
  <button id = "img_Confirm">Click me</button>
  <button id = "toastBtn">Click me</button>
  <script type="text/javascript" src="/js/alert.js"></script>
  <script type="text/javascript" src="/js/adapt.js"></script>
  <script type="text/javascript" src="/js/websocket.js"></script>
  <script>
    var myAlert = new myAlert();
    myAlert.alert('alert提示','创建的弹窗出来了！');
    var img = '1.png';
    function confirmData () {
      console.log('tihsi')
    }
    var alertBtn = document.getElementById('alertBtn');
    var confirm = document.getElementById('confirm');
    var imgConfirm = document.getElementById('img_Confirm');
    var toastBtn = document.getElementById('toastBtn');

    alertBtn.addEventListener('click',function(){
      myAlert.alert('alert提示','创建的弹窗出来了！');
    })
    confirm.addEventListener('click',function(){
      var title = 'confirm提示',
      text = '确定要删除吗？';
      myAlert.confirm(title,text,confirmData);
    })
    imgConfirm.addEventListener('click',function(){
      myAlert.imgConfirm('带图片弹窗','这里是有图片的弹窗,图片必须传入！',img,confirmData);
    })
    toastBtn.addEventListener('click',function(){
      myAlert.toast('toast提示！时间可以自定义单位秒',1);
    })
  </script>
</body>
</html>